﻿Public Partial Class CustomerProductInfo
    Inherits Mysoft.Map.Application.Security.AppPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Content.Text = "<script language=""javascript""> var __xml=""" & GetCustomerProduct() & """;</script>"
        End If
    End Sub

    Private Function GetCustomerProduct() As String
        Dim sql As String
        Dim dt As DataTable
        Dim xml As String

        sql = "SELECT top 1 ID,Customer,Product FROM Lms_CustomerProductInfo"
        dt = Mysoft.Map.LMS.MyDBExtend.GetDataTable(sql)

        If dt IsNot Nothing AndAlso dt.Rows.Count = 1 Then
            xml = "<Lms_CustomerProductInfo>"
            xml += "<ID>" + dt.Rows(0)("ID").ToString() + "</ID>"
            xml += "<Customer>" + dt.Rows(0)("Customer").ToString() + "</Customer>"
            xml += "<Product>" + dt.Rows(0)("Product").ToString() + "</Product>"
            xml += "</Lms_CustomerProductInfo>"
        End If

        Return xml
    End Function


    Protected Overrides Sub ConfigureForm()
        appForm.Execute()
    End Sub
End Class